﻿<?php
	
	echo form_fieldset("");
	
	echo validation_errors();
	
	echo form_open('cliente/editar/'.$cliente->getIdCliente());

	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-user'></i></span>";
		$atributos['id'] = $atributos['name'] = 'nome_cliente';
		$atributos['size'] = 110;
		$atributos['maxlength'] = 110;
		$value = set_value('nome_cliente');
		$atributos['value'] = $value == '' ? $cliente->getNomeCliente() : $value;
		$atributos['title'] = 'Nome do Cliente';		
		$atributos['placeholder'] = 'Nome do Cliente';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-asterisk'></i></span>";
		$options = array(Genero::MASCULINO => 'Masculino', Genero::FEMININO => 'Feminino');
		echo form_dropdown('sexo', $options).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-calendar'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'data_nascimento';
		$atributos['size'] = $atributos['maxlength'] = 11;
		$atributos['readonly'] = "readonly";
		$value = set_value('data_nascimento');
		$atributos['value'] = $value == '' ? $cliente->getDataNascimento() : $value;
		$atributos['onkeypress'] = "formatar(this,'00/00/0000')";
		$atributos['title'] = 'Data de Nascimento';
		$atributos['placeholder'] = 'Data de Nascimento';
		echo form_input($atributos).nbs(5).br();
	echo '</div>';

	echo "<div class='input-prepend'><span class='add-on'><i class='icon-home'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'endereco';
		$atributos['size'] = 100;
		$atributos['maxlength'] = 100;
		$value = set_value('endereco');
		$atributos['value'] = $value == '' ? $cliente->getEndereco() : $value;	
		$atributos['style'] = 'min-width:712px;';
		$atributos['title'] = 'Endereço';
		$atributos['placeholder'] = 'Endereço';
		echo form_input($atributos).nbs(5).br().br();
	echo '</div>';
	
	echo"<b style='font-size:12pt;'>Contatos:</b></br></br>";

	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-bullhorn'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'telefone';
		$atributos['size'] = 15;
		$atributos['maxlength'] = 13;
		$value = set_value('telefone');
		$atributos['value'] = $value == '' ? $cliente->getTelefone() : $value;
		$atributos['onkeypress'] = "formatar(this,'(00)0000-0000')";
		$atributos['title'] = 'Telefone';
		$atributos['placeholder'] = 'Telefone';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-envelope'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'email';
		$atributos['size'] = $atributos['maxlength'] = 46;
		$value = set_value('email');
		$atributos['value'] = $value == '' ? $cliente->getEmail() : $value;
		$atributos['title'] = 'E-mail';
		$atributos['placeholder'] = 'E-mail';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-asterisk'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'outros_contatos';
		$atributos['size'] = $atributos['maxlength'] = 46;
		$value = set_value('outros_contatos');
		$atributos['value'] = $value == '' ? $cliente->getOutrosContatos() : $value;
		$atributos['title'] = 'Outros Contatos';
		$atributos['placeholder'] = 'Outros Contatos';
		echo form_input($atributos).br().br();
	echo '</div>';
	
	echo"<b style='font-size:12pt;'>Informações Adicionais:</b></br></br>";
	
	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-eye-open'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'etnia';
		$atributos['size'] = $atributos['maxlength'] = 23;
		$value = set_value('etnia');
		$atributos['value'] = $value == '' ? $cliente->getEtnia() : $value;	
		$atributos['title'] = 'Etnia';
		$atributos['placeholder'] = 'Etnia';
		echo form_input($atributos).nbs(5);
	echo '</div>';

	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-arrow-up'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'altura';
		$atributos['size'] = $atributos['maxlength'] = 23;
		$value = set_value('altura');
		$atributos['value'] = $value == '' ? $cliente->getAltura() : $value;	
		$atributos['title'] = 'Altura';
		$atributos['placeholder'] = 'Altura';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-resize-full'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'peso';
		$atributos['size'] = $atributos['maxlength'] = 23;
		$value = set_value('peso');
		$atributos['value'] = $value == '' ? $cliente->getPeso() : $value;	
		$atributos['title'] = 'Peso';
		$atributos['placeholder'] = 'Peso';
		echo form_input($atributos).nbs(5).br();
	echo '</div>';
	
	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-exclamation-sign'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'glicemia';
		$atributos['size'] = $atributos['maxlength'] = 23;
		$value = set_value('glicemia');
		$atributos['value'] = $value == '' ? $cliente->getGlicemia() : $value;	
		$atributos['title'] = 'Glicemia';
		$atributos['placeholder'] = 'Glicemia';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend' style='float:left;'><span class='add-on'><i class='icon-exclamation-sign'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'pressao_arterial';
		$atributos['size'] = $atributos['maxlength'] = 23;
		$value = set_value('pressao_arterial');
		$atributos['value'] = $value == '' ? $cliente->getPressaoArterial() : $value;	
		$atributos['title'] = 'Pressão Arterial';
		$atributos['placeholder'] = 'Pressão Arterial';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-plus-sign'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'plano_saude';
		$atributos['size'] = $atributos['maxlength'] = 137;
		$value = set_value('plano_saude');
		$atributos['value'] = $value == '' ? $cliente->getPlanoSaude() : $value;
		$atributos['title'] = 'Plano de Saúde';
		$atributos['placeholder'] = 'Plano de Saúde';
		echo form_input($atributos).nbs(5);
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-user'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'parentes';
		$atributos['size'] = $atributos['maxlength'] = 145;
		$value = set_value('parentes');
		$atributos['value'] = $value == '' ? $cliente->getParentes() : $value;	
		$atributos['style'] = 'min-width:712px;';
		$atributos['title'] = 'Parentes';
		$atributos['placeholder'] = 'Parentes';
		echo form_input($atributos).br();
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-ban-circle'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'contra_indicacao';
		$atributos['size'] = $atributos['maxlength'] = 135;
		$value = set_value('contra_indicacao');
		$atributos['value'] = $value == '' ? $cliente->getContraIndicacao() : $value;	
		$atributos['style'] = 'min-width:712px;';
		$atributos['title'] = 'Contra Indicação';
		$atributos['placeholder'] = 'Contra Indicação';
		echo form_input($atributos).br();
	echo '</div>';

	echo "<div class='input-prepend'><span class='add-on'><i class='icon-shopping-cart'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'onde_costuma_comprar';
		$atributos['size'] = $atributos['maxlength'] = 127;
		$atributos['style'] = 'min-width:712px;';
		$value = set_value('onde_costuma_comprar');
		$atributos['value'] = $value == '' ? $cliente->getOndeCostumaComprar() : $value;
		$atributos['title'] = 'Onde Costuma Comprar';
		$atributos['placeholder'] = 'Onde Costuma Comprar';
		echo form_input($atributos).nbs(5);
	echo '</div>';

	echo "<div class='input-prepend'><span class='add-on'><i class='icon-user'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'medicos_preferidos';
		$atributos['size'] = $atributos['maxlength'] = 133;
		$value = set_value('medicos_preferidos');
		$atributos['value'] = $value == '' ? $cliente->getMedicosPreferidos() : $value;
		$atributos['style'] = 'min-width:712px;';
		$atributos['title'] = 'Médicos Preferidos';
		$atributos['placeholder'] = 'Médicos Preferidos';
		echo form_input($atributos).br();
	echo '</div>';

	echo "<div class='input-prepend'><span class='add-on'><i class='icon-list-alt'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'historico_familiar';
		$atributos['size'] = $atributos['maxlength'] = 136;
		$value = set_value('historico_familiar');
		$atributos['value'] = $value == '' ? $cliente->getHistoricoFamiliar() : $value;	
		$atributos['style'] = 'min-width:712px;';
		$atributos['title'] = 'Histórico Familiar';
		$atributos['placeholder'] = 'Histórico Familiar';
		echo form_input($atributos).br();
	echo '</div>';
	
	echo "<div class='input-prepend'><span class='add-on'><i class='icon-list-alt'></i></span>";
		unset($atributos);
		$atributos['id'] = $atributos['name'] = 'historico_doencas';
		$atributos['size'] = $atributos['maxlength'] = 131;
		$value = set_value('historico_doencas');
		$atributos['value'] = $value == '' ? $cliente->getHistoricoDoencas() : $value;
		$atributos['style'] = 'min-width:712px;';
		$atributos['title'] = 'Histórico de Doenças';
		$atributos['placeholder'] = 'Histórico de Doenças';
		echo form_input($atributos).br();
	echo '</div>';
	
	$attr['class'] = 'btn btn-large btn-primary';
	$attr['value'] = 'Salvar Alterações';
	echo br().form_submit($attr);

	echo form_close();
	
	echo form_fieldset_close();

?>